package com.yjd.comm.enums;

import com.yjd.comm.util.StringUtil;

/**
 * 
import com.yjd.bi.jf.service.IJfIntegralDataService;
import com.yjd.bi.jf.service.IJfIntegralService;
import com.yjd.bi.jf.service.IJfIntegralYearService;
import com.yjd.bi.jf.service.IJfOrderDetailProductSnapshotService;
import com.yjd.bi.jf.service.IJfOrderDetailService;
import com.yjd.bi.jf.service.IJfOrderService;
import com.yjd.bi.jf.service.IJfSignDataService;
import com.yjd.bi.user.service.IUserService;
 * @author chenpengfei
 *
 */
public enum TableInfo {
	JF_INTERAL_DATA("jf_yijiedai_com","yjd_jf_integral_data","jfIntegralDataService","com.yjd.bi.jf.service.IJfIntegralDataService"),
	JF_INTERA("jf_yijiedai_com","yjd_jf_integral","jfIntegralService","com.yjd.bi.jf.service.IJfIntegralService"),
	JF_INTERAL_YEAR("jf_yijiedai_com","yjd_jf_integral_year","jfIntegralYearService","com.yjd.bi.jf.service.IJfIntegralYearService"),
	JF_ORDER("jf_yijiedai_com","yjd_jf_order","jfOrderService","com.yjd.bi.jf.service.IJfOrderService"),
	JF_ORDER_DETAIL("jf_yijiedai_com","yjd_jf_order_detail","jfOrderDetailService","com.yjd.bi.jf.service.IJfOrderDetailService"),
	JF_ORDER_DETAIL_PRODUCT_SNAPSHOT("jf_yijiedai_com","yjd_jf_order_detail_product_snapshot","jfOrderDetailProductSnapshotService","com.yjd.bi.jf.service.IJfOrderDetailProductSnapshotService"),
	JF_SIGN_DATA("jf_yijiedai_com","yjd_jf_sign_data","jfSignDataService","com.yjd.bi.jf.service.IJfSignDataService"),
	USER("www_yijiedai_com","yjd_user","userService","com.yjd.bi.user.service.IUserService"),
	FUNDS_DATA("www_yijiedai_com","yjd_funds_data","fundsDataService","com.yjd.bi.business.service.IFundsDataService"),
	FUNDS_VOLUME("www_yijiedai_com","yjd_funds_volume","fundsVolumeService","com.yjd.bi.rewards.service.IFundsVolumeService");
	
	private String schema;
	private String name;
	private String servicename;
	private String classname;
	
	/**
	 * 
	 * @param schema 库名
	 * @param name 表名
	 * @param servicename service 名
	 * @param classname service classpath
	 */
	TableInfo(String schema,String name,String servicename,String classname){
		this.schema=schema;
		this.name=name;
		this.servicename=servicename;
		this.classname=classname;
	}
	

	public String getClassname() {
		return classname;
	}


	public void setClassname(String classname) {
		this.classname = classname;
	}


	public static TableInfo getInfoByName(String name){
		if(StringUtil.isEmpty(name)){
			return null;
		}
		for(TableInfo inf:TableInfo.values()){
			if(inf.getName().equals(name.trim())){
				return inf;
			}
		}
		return null;
	}
	
	public String getServicename() {
		return servicename;
	}
	public void setServicename(String servicename) {
		this.servicename = servicename;
	}
	public String getSchema() {
		return schema;
	}
	public void setSchema(String schema) {
		this.schema = schema;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
}
